Extensible Markup Language (XML) is a markup language designed to structure, store, and transport information. The purpose of XML is to aid information systems in sharing structured data, to encode documents, and to serialize data. XML data is stored as plain text in XML files. XML files contain a root element. This element is the parent of all other elements in the XML file. The elements in an XML file form a document tree. The tree starts at the root and branches to the lowest level of the tree. Elements can generally have child elements. Children elements on the same level are called siblings. Elements can generally have text content and attributes.
The XML DOM (Document Object Model) defines a standard way for accessing and manipulating XML files. The DOM views XML files as a tree-structure. All elements can be accessed through the DOM tree. The content of the elements (text and attributes) can be modified or deleted, and new elements can be created. The elements and their attributes are known as nodes.
XML files may be validated utilizing Document Type Definition (DTD) files or XML schema files. A DTD file or XML schema file defines the legal building blocks of an XML file. The DTD file or XML schema file defines the file structure with a list of legal elements and attributes. DTDs or XML schemas can be utilized to validate the structure of an XML file and the type of text content contained in elements and attributes. However, DTDs or XML schemas cannot be utilized to semantically validate the text content contained in elements or attributes. For example, DTDs or XML schemas cannot be utilized to validate that the text content of an element is within a subset of another element's text content. DTDs may also be utilized to specify default values for elements and attributes. However, these default values are hardwired and cannot be automatically calculated or adjusted to the data they service. For example, DTDs or XML schemas cannot be utilized to set a default of one XML element based on the text content of another XML element.